// SPA_Data_Types.h : Defines all SPA self defined data types.
// Author: Heng Belson
//
#ifndef SPA_DATA_TYPES_H
#define SPA_DATA_TYPES_H
#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <stack>
#include <fstream>
#include <string>
#include <ctype.h>
#include <queue>

using namespace std;

typedef string STRING;
typedef int INTEGER;
typedef bool BOOLEAN;

typedef string TOKEN;	
typedef queue<STRING> PROC_QUEUE;
typedef queue<STRING> VAR_QUEUE;

// added by sudhir=====
typedef int PROC_INDEX;
typedef int VAR_INDEX;
typedef int INDEX;

// ====================

// added by achyut----
typedef int STATEMENT_INDEX;
typedef vector<STATEMENT_INDEX> STMT_LIST;
typedef vector<PROC_INDEX> PROC_LIST;
enum VECTORLIST_TYPE { STMT_VECTOR, PROC_VECTOR};
//------

typedef vector<STRING> COLLECTION;
typedef vector<TOKEN> TOKEN_LIST;

enum QRYSTATEMENT_TYPE { _ASSIGN, _CALL, _IF, _WHILE, _PROCEDURE, _STMTLIST, _STMT, _VARIABLE, _CONSTANT, _INTEGER, _SYNONYMNS, _INVALID, _BOOLEAN, _EMPTY};
enum LIST_TYPE { USED, MODIFIED};
enum OP_TYPE { OP_Times, OP_Plus, OP_Minus };
enum NUMERIC_EXPR_TYPE { NUMERIC_EXPR_TYPE_VARIABLE, NUMERIC_EXPR_TYPE_CONSTANT };
enum STATEMENT_TYPE { STATEMENT_Assign, STATEMENT_Call, STATEMENT_If, STATEMENT_While, STATEMENT_Invalid };
enum EXPRESSION_TYPE { EXPRESSION_Times, EXPRESSION_Plus, EXPRESSION_Minus, EXPRESSION_Constant, EXPRESSION_Variable };
enum STATUS { STATUS_Success, STATUS_Failure, STATUS_Not_Processed };
enum QueryEntityType
{
	RESULT, SUCHTHAT, WITH, PATTERN, RELATIONSHIP, ARGUMENT, ATTRREF, INTARGUMENT,VARARGUMENT,PROCARGUMENT
};

enum WITHTYPE{ _COMPARISON, _VALUE };

struct Argument{
	int argument;// QueryStatementType
	int argumentInd;// Index of the variable
	int argumentType;//QRY_STATEMENTTYPE
};

enum ResultType{ RESULT_NORMAL, RESULT_BOOLEAN };
struct resultTypes {
	vector<vector<int>> resultEntity;

};
struct Result{
	vector<resultTypes> resultVector;
	bool resultExists;// returns the result for boolean queries
	ResultType resultType; //tells if boolean required or normal
    QRYSTATEMENT_TYPE selectedType;// mapping to qry statement type
	int resultIndex;
	int noOfRows;
};


enum linkType
	{
		CHILD, SIBLING
	};
#endif